
#pragma once

#include "type.h"
#include <list>

#define PLAY_SOUND(s)   SoundManager::play(s)
#define PLAY_UISOUND(s) SoundManager::playUI(s)
#define PLAY_SOUND_BG   SoundManager::gameBGStart()

enum class BGMusicType {
	count,
};

enum class SoundId {
    
	count,
};

enum class BulletType;

class SoundManager {
public:
	static void init(bool isSoundOn, bool needWaiting);
	
	static void playUI(SoundId sid);
	static void play(SoundId sid, bool forcePlay = false);

    static void stop(int sid);
	static void stopAll();

	static void setBgId(BGMusicType id);
	static void gameBGStart();
	static void gameBGStop();

	static void setbgMusicPlay(bool play);

    static bool isSoundOn() {
		return _isEfSoundOn;
	}
	static void setSoundState(bool state) {
        _isEfSoundOn = state;
    }

    static void update(float ticks);

private:
	static bool _isEfSoundOn;

    static std::string _arrSoundFiles[(int)SoundId::count];
	static const float _arrSoundDuration[(int)SoundId::count];

	static bool isBackgroundOn;
	static BGMusicType bgid;
    
};

